<!doctype>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="description" content="">
    <meta name="keyword" content="">
    <title>修改手机号</title>
    <link rel="stylesheet" href="/Public/Home/css/common.css">
    <link rel="stylesheet" href="/Public/Home/css/index.css">
    <link rel="stylesheet" href="/Public/Home/css/L-index.css">

</head>
<body>
<!--引入头部 star-->
<include file="Public/header" />
<!--end-->
    <div class="cont clearfix">
        <!--引入左边 star-->
        <include file="Public/center_left" />
        <!--end-->
        <div class="right">
            <div class="xgmm">
                <input type="number" id="old_phone" value="" placeholder="请输入原手机号码" class="input">
                <input type="number" id="new_phone" value="" placeholder="请输入新手机号码" class="input">
                <div class="yzm_cont clearfix">
                    <input type="password" id="code" placeholder="验证码" class="input" style="width:88px">
                    <input type="button" value="发送验证码" class="input yzm">
                </div>
                <button class="sure_modify">确认修改</button>
            </div>
        </div>
    </div>
    
<include file="Public/footer" />
</body>
<script src="/Public/Home/js/jquery-1.12.4.min.js"></script>
<script>
    //获取验证码
    $('.yzm').click(function(){
        var phone = $('#new_phone').val();
        $.post("{:U('Home/Post/getCode')}",{
            phone:phone
        },function(res){
            console.log(res);
            // if(res.err == 0){
            //     window.location.href="{:U('Home/Login/login')}"
            // }
        },'json')
    });
    //提交
    $('.sure_modify').click(function(){
        var old_phone = $('#old_phone').val();
        var new_phone = $('#new_phone').val();
        var code = $('#code').val();
        $.post("{:U('Home/center/modifypnone')}",{
            old_phone:old_phone,
            new_phone:new_phone,
            code:code
        },function(res){
            console.log(res);
            // if(res.err == 0){
            //     window.location.href="{:U('Home/Login/login')}"
            // }
        },'json')
    });
</script>
</html>